<template>
    <div class="dialoglistDiv">
        <div class="dialogsearchDiv">
            <DateRange v-model:start="obj.req.starttime" v-model:end="obj.req.endtime" sph="考勤时间"  />
            <span class="btn search" @click="init">搜索</span>
            <span class="btn refresh" @click="obj.req.currentpage=1;init()"></span>
            <!-- <span class="btn download" @click="export_"></span> -->
        </div>
        <div class="table_box">
            <div class="table_" id="tb">
                <ul class="head">
                    <li class="liflex">日期</li>
                    <li class="li2">签到时间</li>
                    <li class="li2">签退时间</li>
                    <li class="li3">工作日/休息日</li>
                </ul>
                <div class="body">
                    <ul v-for="x in obj.ary" :key="x">
                        <li class="liflex">{{x.repDate}}</li>
                        <li class="li2">{{x.sign_id}}</li>
                        <li class="li2">{{x.sign_out}}</li>
                        <li class="li3">{{x.db_status==0?'工作日':'休息日'}}</li>
                        
                    </ul>
                </div>
            </div>
        </div>
        <!-- <Pager :value="obj.req" :init="init" /> -->
    </div>
</template>

<script setup>
    import { reactive, getCurrentInstance, ref, toRefs, provide, computed } from 'vue'
    import DateRange from '@/components/date_range.vue'
    import Pager from '@/components/pager.vue'
    let { proxy } = getCurrentInstance()
    const props = defineProps({
        property_id: { type: String }
    })

    let obj = reactive({
        ary: [],
        req: {
            currentpage: 1,
            pagesize: 10,
            count: 0,
            property_id: props.property_id,
            endtime: proxy.$utils.getLastDay(),
            starttime: proxy.$utils.getFirstDay(),
        }
    });
    let init = () => {
        if(!obj.req.starttime||!obj.req.endtime){
            proxy.elMessageMixin('请选择时间段筛选', 'error')
            return
        }
        proxy.$ajax({
            url: 'property/sign',
            data: obj.req,
            bfLoading: true
        }).then(d => {
            // console.log(d)
            if(d.success){
                obj.ary = d.msg.list
                obj.req.count = d.msg.count
            }
        }).catch(() => { })
    }
    init()
</script>

<style scoped>
    ::-webkit-scrollbar { width:10px; background-color: #FFFFFF; }
    .listDiv { top:70px; }
    #tb ul li.li2 { width: 120px; }
    #tb ul li.li3 { width: 140px; }
</style>